<?php
/**
* 게시판 권한 로직 처리
* /ezadm/logic/board/ezbbs_auth.php
* since 2006-10-25
* update 2010-03-04
* ezdong <ezdong@nextez.co.kr> & hamhaja <hamhaja@nextez.co.kr>
*/
// 경로 / 인증 체크
require_once dirname(__FILE__) . '/../../inc.auth.php';

// 클래스 인스턴스
//$App->class_require('Table.Membergrp');
$App->class_require('Table.Ezbbscnf');
//$Membergrp	= new Membergrp(&$Db);
$Ezbbscnf	= new Ezbbscnf(&$Db);

if ($g_subjob == 'update_form')
{
	// get board auth record
	$columns = array('ebcf_id',	'ebcf_pname', 'ebcf_admgrp_list', 'ebcf_admin_list', 'ebcf_list_level', 'ebcf_view_level', 'ebcf_insert_level', 'ebcf_update_level', 'ebcf_delete_level', 'ebcf_answer_level', 'ebcf_reply_level');

	$auth_record = $Ezbbscnf->get_a_record($columns, array($_GET['ebcf_id']));
	if ($auth_record)
	{
		$Ezbbscnf->htmlchars($auth_record);

		if ($auth_record['ebcf_admgrp_list']) $auth_record['groups'] = split(',', $auth_record['ebcf_admgrp_list']);
		else $auth_record['groups'] = array();

		// get group list
		//$member_groups = & $Membergrp->get_list('', '', '', 'mg_id');
		$member_groups = array();

		// get level list
		$levels = array($User->get_default_level() => $User->get_default_name()) + $User->get_levels();

		// set global page title
		$g_page_title = $auth_record['ebcf_id'] . ' :: ' . $auth_record['ebcf_pname'];
	}
	else $Error->notice(NOT_FIND_DATA);
}
else if ($g_subjob == 'update')
{
	if (!$App->check_method(POST)) $Error->fail(NO_PERMIT_METHOD);

	if ($Ezbbscnf->update($_POST, array($_POST['ebcf_id']))) $App->reload();
	else $Error->fail(UPDATE_FAIL);
}
?>